﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Pomelo.EntityFrameworkCore.MySql.Scaffolding.Internal;

namespace ZH.Infrastructure.EFCore.MySql;

public partial class ZygdbContext : DbContext
{
    public ZygdbContext()
    {
    }

    public ZygdbContext(DbContextOptions<ZygdbContext> options)
        : base(options)
    {
    }

    public virtual DbSet<Admin> Admins { get; set; }

    public virtual DbSet<Adminloginlog> Adminloginlogs { get; set; }

    public virtual DbSet<Appointment> Appointments { get; set; }

    public virtual DbSet<Article> Articles { get; set; }

    public virtual DbSet<Cashier> Cashiers { get; set; }

    public virtual DbSet<Cashierloginlog> Cashierloginlogs { get; set; }

    public virtual DbSet<Copywriting> Copywritings { get; set; }

    public virtual DbSet<Dictionary> Dictionaries { get; set; }

    public virtual DbSet<Employee> Employees { get; set; }

    public virtual DbSet<Fwcollect> Fwcollects { get; set; }

    public virtual DbSet<Mobile> Mobiles { get; set; }

    public virtual DbSet<Mobileloginlog> Mobileloginlogs { get; set; }

    public virtual DbSet<Order> Orders { get; set; }

    public virtual DbSet<Orderdetail> Orderdetails { get; set; }

    public virtual DbSet<Poster> Posters { get; set; }

    public virtual DbSet<Product> Products { get; set; }

    public virtual DbSet<Record> Records { get; set; }

    public virtual DbSet<Room> Rooms { get; set; }

    public virtual DbSet<Schedule> Schedules { get; set; }

    public virtual DbSet<Technique> Techniques { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
        => optionsBuilder.UseMySql("server=localhost;database=zygdb;uid=root;pwd=123456", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.30-mysql"));

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder
            .UseCollation("utf8mb4_0900_ai_ci")
            .HasCharSet("utf8mb4");

        modelBuilder.Entity<Admin>(entity =>
        {
            entity.HasKey(e => e.Uid).HasName("PRIMARY");

            entity
                .ToTable("admin")
                .UseCollation("utf8mb4_unicode_ci");

            entity.Property(e => e.Uid)
                .HasMaxLength(50)
                .HasComment("编号")
                .HasColumnName("UId");
            entity.Property(e => e.Uaccount)
                .HasMaxLength(50)
                .HasComment("账号")
                .HasColumnName("UAccount");
            entity.Property(e => e.Ubirthday)
                .HasComment("生日")
                .HasColumnType("datetime")
                .HasColumnName("UBirthday");
            entity.Property(e => e.UcreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("UCreateTime");
            entity.Property(e => e.Udesc)
                .HasMaxLength(50)
                .HasComment("描述")
                .HasColumnName("UDesc");
            entity.Property(e => e.Ugender)
                .HasMaxLength(10)
                .HasComment("性别")
                .HasColumnName("UGender");
            entity.Property(e => e.UisActive)
                .HasComment("是否激活")
                .HasColumnName("UIsActive");
            entity.Property(e => e.UisBan)
                .HasComment("是否禁用")
                .HasColumnName("UIsBan");
            entity.Property(e => e.Uname)
                .HasMaxLength(50)
                .HasComment("姓名")
                .HasColumnName("UName");
            entity.Property(e => e.Upassword)
                .HasMaxLength(100)
                .HasComment("密码")
                .HasColumnName("UPassword");
            entity.Property(e => e.Uphone)
                .HasMaxLength(20)
                .HasComment("电话")
                .HasColumnName("UPhone");
            entity.Property(e => e.Usalt)
                .HasMaxLength(50)
                .HasComment("盐")
                .HasColumnName("USalt");
        });

        modelBuilder.Entity<Adminloginlog>(entity =>
        {
            entity.HasKey(e => e.LlId).HasName("PRIMARY");

            entity.ToTable("adminloginlog");

            entity.Property(e => e.LlId).HasMaxLength(50);
            entity.Property(e => e.LlCode).HasMaxLength(50);
            entity.Property(e => e.LlCreateTime).HasColumnType("datetime");
            entity.Property(e => e.LlUid)
                .HasMaxLength(50)
                .HasColumnName("LlUId");
        });

        modelBuilder.Entity<Appointment>(entity =>
        {
            entity.HasKey(e => e.Aid).HasName("PRIMARY");

            entity.ToTable("appointment");

            entity.Property(e => e.Aid)
                .HasMaxLength(50)
                .HasColumnName("aid");
            entity.Property(e => e.AppointmentDate)
                .HasMaxLength(50)
                .HasComment("预约日期")
                .HasColumnName("appointment_date");
            entity.Property(e => e.CreatedAt)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("created_at");
            entity.Property(e => e.CustomerName)
                .HasMaxLength(100)
                .HasComment("客户姓名")
                .HasColumnName("customer_name");
            entity.Property(e => e.CustomerPhone)
                .HasMaxLength(20)
                .HasComment("客户电话")
                .HasColumnName("customer_phone");
            entity.Property(e => e.EndTime)
                .HasMaxLength(50)
                .HasComment("预约结束时间")
                .HasColumnName("end_time");
            entity.Property(e => e.MId)
                .HasMaxLength(50)
                .HasComment("用户id（如果是收银端添加则为空）")
                .HasColumnName("M_id");
            entity.Property(e => e.Notes)
                .HasComment("备注信息（如客户特殊需求等）")
                .HasColumnType("text")
                .HasColumnName("notes");
            entity.Property(e => e.ServiceId)
                .HasMaxLength(255)
                .HasComment("服务项目编号")
                .HasColumnName("service_id");
            entity.Property(e => e.ServiceItem)
                .HasMaxLength(50)
                .HasComment("服务项目（如按摩、理疗等）")
                .HasColumnName("service_item");
            entity.Property(e => e.StartTime)
                .HasMaxLength(50)
                .HasComment("预约开始时间")
                .HasColumnName("start_time");
            entity.Property(e => e.Status)
                .HasDefaultValueSql("'待处理'")
                .HasComment("预约状态")
                .HasColumnType("enum('待处理','已确认','已取消','已完成')")
                .HasColumnName("status");
            entity.Property(e => e.UpdatedAt)
                .ValueGeneratedOnAddOrUpdate()
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("updated_at");
        });

        modelBuilder.Entity<Article>(entity =>
        {
            entity.HasKey(e => e.AiId).HasName("PRIMARY");

            entity.ToTable("article");

            entity.Property(e => e.AiId)
                .HasMaxLength(34)
                .HasComment("文章id")
                .HasColumnName("aiID");
            entity.Property(e => e.AiAuthor)
                .HasMaxLength(24)
                .HasComment("文章作者")
                .HasColumnName("aiAuthor");
            entity.Property(e => e.AiBody)
                .HasComment("文章内容")
                .HasColumnType("text")
                .HasColumnName("aiBody");
            entity.Property(e => e.AiBrowse)
                .HasComment("浏览量")
                .HasColumnName("aiBrowse");
            entity.Property(e => e.AiCollect)
                .HasComment("收藏量")
                .HasColumnName("aiCollect");
            entity.Property(e => e.AiImg)
                .HasMaxLength(32)
                .HasComment("文章图片")
                .HasColumnName("aiImg");
            entity.Property(e => e.AiTitle)
                .HasMaxLength(30)
                .HasComment("文章标题")
                .HasColumnName("aiTitle");
            entity.Property(e => e.ReleaseTime)
                .HasComment("发布时间")
                .HasColumnType("datetime")
                .HasColumnName("release_time");
        });

        modelBuilder.Entity<Cashier>(entity =>
        {
            entity.HasKey(e => e.Cid).HasName("PRIMARY");

            entity
                .ToTable("cashier")
                .UseCollation("utf8mb4_unicode_ci");

            entity.Property(e => e.Cid)
                .HasMaxLength(50)
                .HasComment("编号")
                .HasColumnName("CId");
            entity.Property(e => e.Caccount)
                .HasMaxLength(50)
                .HasComment("账号")
                .HasColumnName("CAccount");
            entity.Property(e => e.Cbirthday)
                .HasComment("生日")
                .HasColumnType("datetime")
                .HasColumnName("CBirthday");
            entity.Property(e => e.CcreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("CCreateTime");
            entity.Property(e => e.Cdesc)
                .HasMaxLength(50)
                .HasComment("描述")
                .HasColumnName("CDesc");
            entity.Property(e => e.Cgender)
                .HasMaxLength(10)
                .HasComment("性别")
                .HasColumnName("CGender");
            entity.Property(e => e.CisActive)
                .HasComment("是否激活")
                .HasColumnName("CIsActive");
            entity.Property(e => e.CisBan)
                .HasComment("是否禁用")
                .HasColumnName("CIsBan");
            entity.Property(e => e.Cname)
                .HasMaxLength(50)
                .HasComment("姓名")
                .HasColumnName("CName");
            entity.Property(e => e.Cpassword)
                .HasMaxLength(100)
                .HasComment("密码")
                .HasColumnName("CPassword");
            entity.Property(e => e.Cphone)
                .HasMaxLength(20)
                .HasComment("电话")
                .HasColumnName("CPhone");
            entity.Property(e => e.Csalt)
                .HasMaxLength(50)
                .HasComment("盐")
                .HasColumnName("CSalt");
        });

        modelBuilder.Entity<Cashierloginlog>(entity =>
        {
            entity.HasKey(e => e.ClId).HasName("PRIMARY");

            entity.ToTable("cashierloginlog");

            entity.Property(e => e.ClId).HasMaxLength(50);
            entity.Property(e => e.ClAccount).HasMaxLength(255);
            entity.Property(e => e.ClCode).HasMaxLength(255);
            entity.Property(e => e.ClCreateTime).HasColumnType("datetime");
            entity.Property(e => e.ClIp).HasMaxLength(50);
            entity.Property(e => e.ClName).HasMaxLength(50);
        });

        modelBuilder.Entity<Copywriting>(entity =>
        {
            entity.HasKey(e => e.CId).HasName("PRIMARY");

            entity.ToTable("copywriting");

            entity.Property(e => e.CId)
                .HasMaxLength(34)
                .HasComment("文案id")
                .HasColumnName("cID");
            entity.Property(e => e.CLength)
                .HasComment("文案长度(长文类0、短句类1)")
                .HasColumnName("cLength");
            entity.Property(e => e.CTime)
                .HasComment("发布时间")
                .HasColumnType("datetime")
                .HasColumnName("cTime");
            entity.Property(e => e.Cbody)
                .HasComment("文案内容")
                .HasColumnType("text")
                .HasColumnName("cbody");
            entity.Property(e => e.Ctype)
                .HasMaxLength(50)
                .HasComment("文案类型(针灸类、推拿类)")
                .HasColumnName("ctype");
        });

        modelBuilder.Entity<Dictionary>(entity =>
        {
            entity.HasKey(e => e.Did).HasName("PRIMARY");

            entity.ToTable("dictionary");

            entity.Property(e => e.Did)
                .HasMaxLength(50)
                .HasComment("字典ID")
                .HasColumnName("DId");
            entity.Property(e => e.DcreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("DCreateTime");
            entity.Property(e => e.Dexplain)
                .HasMaxLength(255)
                .HasComment("描述")
                .HasColumnName("DExplain");
            entity.Property(e => e.Dicon)
                .HasMaxLength(255)
                .HasComment("图标代码")
                .HasColumnName("DIcon");
            entity.Property(e => e.DisBan)
                .HasComment("是否禁用")
                .HasColumnName("DIsBan");
            entity.Property(e => e.DisType)
                .HasComment("是否是类型")
                .HasColumnName("DIsType");
            entity.Property(e => e.Dname)
                .HasMaxLength(100)
                .HasComment("名称")
                .HasColumnName("DName");
            entity.Property(e => e.Dno)
                .HasComment("序号")
                .HasColumnName("DNo");
            entity.Property(e => e.DparentId)
                .HasMaxLength(255)
                .HasComment("上级ID")
                .HasColumnName("DParentId");
            entity.Property(e => e.Dvalue)
                .HasMaxLength(255)
                .HasComment("字典值")
                .HasColumnName("DValue");
        });

        modelBuilder.Entity<Employee>(entity =>
        {
            entity.HasKey(e => e.EmpId).HasName("PRIMARY");

            entity.ToTable("employee", tb => tb.HasComment("员工基本信息"));

            entity.Property(e => e.EmpId)
                .HasMaxLength(50)
                .HasComment("员工ID")
                .HasColumnName("emp_id");
            entity.Property(e => e.EavatarUrl)
                .HasMaxLength(255)
                .HasComment("头像URL")
                .HasColumnName("eavatar_url");
            entity.Property(e => e.EcreatedAt)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间")
                .HasColumnType("timestamp")
                .HasColumnName("ecreated_at");
            entity.Property(e => e.EepartmentId)
                .HasMaxLength(50)
                .HasComment("部门ID")
                .HasColumnName("eepartment_id");
            entity.Property(e => e.Egender)
                .HasComment("性别")
                .HasColumnType("enum('男','女')")
                .HasColumnName("egender");
            entity.Property(e => e.EhireDate)
                .HasComment("入职日期")
                .HasColumnType("datetime")
                .HasColumnName("ehire_date");
            entity.Property(e => e.Ename)
                .HasMaxLength(50)
                .HasComment("员工姓名")
                .HasColumnName("ename");
            entity.Property(e => e.Ephone)
                .HasMaxLength(20)
                .HasComment("联系电话")
                .HasColumnName("ephone");
            entity.Property(e => e.Especialty)
                .HasMaxLength(255)
                .HasComment("专长")
                .HasColumnName("especialty");
            entity.Property(e => e.Estatus)
                .HasDefaultValueSql("'在职'")
                .HasComment("状态")
                .HasColumnType("enum('在职','休假','离职')")
                .HasColumnName("estatus");
            entity.Property(e => e.EupdatedAt)
                .ValueGeneratedOnAddOrUpdate()
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("更新时间")
                .HasColumnType("timestamp")
                .HasColumnName("eupdated_at");
            entity.Property(e => e.WorkStatus)
                .HasMaxLength(20)
                .HasComment("工作状态")
                .HasColumnName("work_status");
        });

        modelBuilder.Entity<Fwcollect>(entity =>
        {
            entity.HasKey(e => e.FId).HasName("PRIMARY");

            entity.ToTable("fwcollect");

            entity.Property(e => e.FId)
                .HasMaxLength(34)
                .HasComment("id")
                .HasColumnName("fId");
            entity.Property(e => e.FMid)
                .HasMaxLength(34)
                .HasComment("收藏者id")
                .HasColumnName("fMID");
            entity.Property(e => e.FtechId)
                .HasMaxLength(34)
                .HasComment("服务id")
                .HasColumnName("ftechID");
        });

        modelBuilder.Entity<Mobile>(entity =>
        {
            entity.HasKey(e => e.Mid).HasName("PRIMARY");

            entity
                .ToTable("mobile")
                .UseCollation("utf8mb4_unicode_ci");

            entity.Property(e => e.Mid)
                .HasMaxLength(50)
                .HasComment("编号")
                .HasColumnName("MId");
            entity.Property(e => e.Email)
                .HasMaxLength(255)
                .HasComment("邮箱")
                .HasColumnName("email");
            entity.Property(e => e.Maccount)
                .HasMaxLength(50)
                .HasComment("账号")
                .HasColumnName("MAccount");
            entity.Property(e => e.Mbirthday)
                .HasComment("生日")
                .HasColumnType("datetime")
                .HasColumnName("MBirthday");
            entity.Property(e => e.McreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("MCreateTime");
            entity.Property(e => e.Mdesc)
                .HasMaxLength(50)
                .HasComment("描述")
                .HasColumnName("MDesc");
            entity.Property(e => e.MemberLevel)
                .HasMaxLength(255)
                .HasComment("会员等级")
                .HasColumnName("Member_level");
            entity.Property(e => e.MemberStatus)
                .HasComment("会员状态")
                .HasColumnType("datetime")
                .HasColumnName("Member_status");
            entity.Property(e => e.Mgender)
                .HasMaxLength(10)
                .HasComment("性别")
                .HasColumnName("MGender");
            entity.Property(e => e.MisActive)
                .HasComment("是否激活1为激活")
                .HasColumnName("MIsActive");
            entity.Property(e => e.MisBan)
                .HasComment("是否禁用0为没禁用")
                .HasColumnName("MIsBan");
            entity.Property(e => e.Mname)
                .HasMaxLength(50)
                .HasComment("姓名")
                .HasColumnName("MName");
            entity.Property(e => e.Mpassword)
                .HasMaxLength(100)
                .HasComment("密码")
                .HasColumnName("MPassword");
            entity.Property(e => e.Mphone)
                .HasMaxLength(20)
                .HasComment("电话")
                .HasColumnName("MPhone");
            entity.Property(e => e.Mregister)
                .HasMaxLength(255)
                .HasComment("为什么注册（被推广的方式）");
            entity.Property(e => e.Msalt)
                .HasMaxLength(50)
                .HasComment("盐")
                .HasColumnName("MSalt");
            entity.Property(e => e.ReferrerId)
                .HasMaxLength(255)
                .HasComment("推荐人id （0为自己注册）")
                .HasColumnName("referrer_id");
        });

        modelBuilder.Entity<Mobileloginlog>(entity =>
        {
            entity.HasKey(e => e.MlId).HasName("PRIMARY");

            entity.ToTable("mobileloginlog");

            entity.Property(e => e.MlId).HasMaxLength(50);
            entity.Property(e => e.MlAccount).HasMaxLength(250);
            entity.Property(e => e.MlCode).HasMaxLength(255);
            entity.Property(e => e.MlCreateTime).HasColumnType("datetime");
            entity.Property(e => e.MlIp).HasMaxLength(50);
            entity.Property(e => e.MlName).HasMaxLength(50);
        });

        modelBuilder.Entity<Order>(entity =>
        {
            entity.HasKey(e => e.OrId).HasName("PRIMARY");

            entity.ToTable("order");

            entity.Property(e => e.OrId)
                .HasMaxLength(50)
                .HasComment("订单编号")
                .HasColumnName("or_id");
            entity.Property(e => e.DiscountPrice)
                .HasPrecision(10, 2)
                .HasComment("折扣价")
                .HasColumnName("discount_price");
            entity.Property(e => e.Emid)
                .HasMaxLength(255)
                .HasComment("服务员工编号")
                .HasColumnName("emid");
            entity.Property(e => e.OrCreatTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("or_CreatTime");
            entity.Property(e => e.OrMid)
                .HasMaxLength(50)
                .HasComment("客户编号")
                .HasColumnName("or_mid")
                .UseCollation("utf8mb4_unicode_ci");
            entity.Property(e => e.OrMoney)
                .HasPrecision(10, 2)
                .HasComment("订单金额")
                .HasColumnName("or_money");
            entity.Property(e => e.OrPayment)
                .HasMaxLength(50)
                .HasComment("支付方式")
                .HasColumnName("or_payment");
            entity.Property(e => e.OrStatus)
                .HasComment("订单状态(1=待支付,2=进行中,3=已完成,4=已取消)")
                .HasColumnName("or_status");
            entity.Property(e => e.Roid)
                .HasMaxLength(255)
                .HasComment("房间编号")
                .HasColumnName("roid");
        });

        modelBuilder.Entity<Orderdetail>(entity =>
        {
            entity.HasKey(e => e.Odid).HasName("PRIMARY");

            entity.ToTable("orderdetail");

            entity.Property(e => e.OdCreateTime)
                .HasColumnType("datetime")
                .HasColumnName("Od_CreateTime");
            entity.Property(e => e.OdDuration).HasColumnName("Od_Duration");
            entity.Property(e => e.OdMoney).HasColumnName("Od_Money");
            entity.Property(e => e.OdName)
                .HasMaxLength(50)
                .HasColumnName("Od_name");
            entity.Property(e => e.OrId)
                .HasMaxLength(255)
                .HasColumnName("Or_id");
        });

        modelBuilder.Entity<Poster>(entity =>
        {
            entity.HasKey(e => e.PId).HasName("PRIMARY");

            entity.ToTable("poster");

            entity.Property(e => e.PId)
                .HasMaxLength(34)
                .HasComment("海报id")
                .HasColumnName("pID");
            entity.Property(e => e.PTime)
                .HasComment("发布时间")
                .HasColumnType("datetime")
                .HasColumnName("pTime");
            entity.Property(e => e.Ptype)
                .HasComment("海报类型(针灸类、推拿类)")
                .HasColumnName("ptype");
            entity.Property(e => e.Purl)
                .HasMaxLength(32)
                .HasComment("海报地址")
                .HasColumnName("purl");
        });

        modelBuilder.Entity<Product>(entity =>
        {
            entity.HasKey(e => e.Pid).HasName("PRIMARY");

            entity.ToTable("product");

            entity.Property(e => e.Pid)
                .HasComment("product")
                .HasColumnName("pid");
            entity.Property(e => e.Earlywarning).HasComment("库存预警");
            entity.Property(e => e.Inventory)
                .HasComment("库存")
                .HasColumnName("inventory");
            entity.Property(e => e.PDetails)
                .HasMaxLength(255)
                .HasComment("产品介绍")
                .HasColumnName("pDetails");
            entity.Property(e => e.Pcover)
                .HasMaxLength(255)
                .HasComment("产品封面")
                .HasColumnName("pcover");
            entity.Property(e => e.Pcreationtime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("pcreationtime");
            entity.Property(e => e.PisBan)
                .HasComment("是否禁用")
                .HasColumnName("pisBan");
            entity.Property(e => e.Pname)
                .HasMaxLength(255)
                .HasComment("产品名")
                .HasColumnName("pname");
            entity.Property(e => e.Price)
                .HasPrecision(10, 2)
                .HasComment("产品价格")
                .HasColumnName("price");
            entity.Property(e => e.Pspecs)
                .HasMaxLength(255)
                .HasComment("产品规格")
                .HasColumnName("pspecs");
            entity.Property(e => e.Ptype)
                .HasMaxLength(255)
                .HasComment("产品类型")
                .HasColumnName("ptype");
        });

        modelBuilder.Entity<Record>(entity =>
        {
            entity.HasKey(e => e.RId).HasName("PRIMARY");

            entity.ToTable("record");

            entity.Property(e => e.RId)
                .HasMaxLength(34)
                .HasComment("id")
                .HasColumnName("rID");
            entity.Property(e => e.RCommission)
                .HasComment("佣金")
                .HasColumnName("rCommission");
            entity.Property(e => e.RMid)
                .HasMaxLength(34)
                .HasComment("推广者")
                .HasColumnName("rMID");
            entity.Property(e => e.RName)
                .HasMaxLength(32)
                .HasComment("被推广者姓名")
                .HasColumnName("rName");
            entity.Property(e => e.RPhone)
                .HasMaxLength(11)
                .HasComment("被推广者号码")
                .HasColumnName("rPhone");
            entity.Property(e => e.RSername)
                .HasMaxLength(255)
                .HasComment("被推广者参加的服务名称")
                .HasColumnName("rSername");
            entity.Property(e => e.RSerprice)
                .HasComment("被推广者参加的服务价格")
                .HasColumnName("rSerprice");
            entity.Property(e => e.RState)
                .HasComment("状态（0结算，1待结算）")
                .HasColumnName("rState");
            entity.Property(e => e.RTime)
                .HasComment("推广时间")
                .HasColumnType("datetime")
                .HasColumnName("rTime");
            entity.Property(e => e.RType)
                .HasMaxLength(6)
                .HasComment("推广类型（二维码，链接）")
                .HasColumnName("rType");
        });

        modelBuilder.Entity<Room>(entity =>
        {
            entity.HasKey(e => e.Roid).HasName("PRIMARY");

            entity.ToTable("room");

            entity.Property(e => e.Roid).HasColumnName("roid");
            entity.Property(e => e.Roname)
                .HasMaxLength(255)
                .HasColumnName("roname");
            entity.Property(e => e.Rostart)
                .HasMaxLength(255)
                .HasColumnName("rostart");
        });

        modelBuilder.Entity<Schedule>(entity =>
        {
            entity.HasKey(e => e.Id).HasName("PRIMARY");

            entity.ToTable("schedule");

            entity.HasIndex(e => new { e.EmpId, e.DayOfWeek }, "unique_therapist_day").IsUnique();

            entity.Property(e => e.Id).HasColumnName("id");
            entity.Property(e => e.CreatedAt)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间")
                .HasColumnType("timestamp")
                .HasColumnName("created_at");
            entity.Property(e => e.DayOfWeek)
                .HasComment("星期几（1-7，1表示周一，7表示周日）")
                .HasColumnName("day_of_week");
            entity.Property(e => e.EmpId)
                .HasMaxLength(50)
                .HasComment("员工编号")
                .HasColumnName("emp_id");
            entity.Property(e => e.EndTime)
                .HasComment("结束时间（休息或事假时可为NULL）")
                .HasColumnType("time")
                .HasColumnName("end_time");
            entity.Property(e => e.Notes)
                .HasMaxLength(200)
                .HasComment("备注")
                .HasColumnName("notes");
            entity.Property(e => e.ShiftType)
                .HasMaxLength(20)
                .HasComment("班次类型（早班、中班、晚班、备班、休息等）")
                .HasColumnName("shift_type");
            entity.Property(e => e.StartTime)
                .HasComment("开始时间（休息或事假时可为NULL）")
                .HasColumnType("time")
                .HasColumnName("start_time");
            entity.Property(e => e.UpdatedAt)
                .ValueGeneratedOnAddOrUpdate()
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("更新时间")
                .HasColumnType("timestamp")
                .HasColumnName("updated_at");
        });

        modelBuilder.Entity<Technique>(entity =>
        {
            entity.HasKey(e => e.TechId).HasName("PRIMARY");

            entity.ToTable("techniques");

            entity.Property(e => e.TechId)
                .HasComment("技法编号")
                .HasColumnName("tech_id");
            entity.Property(e => e.IsBan)
                .HasComment("是否禁用")
                .HasColumnName("isBan");
            entity.Property(e => e.IsSafe)
                .HasMaxLength(255)
                .HasComment("是否安全技法（需专业操作）：0 = 需医师操作，1 = 可助理操作")
                .HasColumnName("is_safe");
            entity.Property(e => e.TechDesc)
                .HasMaxLength(255)
                .HasComment("技法说明")
                .HasColumnName("tech_desc");
            entity.Property(e => e.TechDictype)
                .HasMaxLength(255)
                .HasComment("所需职位")
                .HasColumnName("tech_dictype");
            entity.Property(e => e.TechDuration)
                .HasComment("时长")
                .HasColumnName("tech_duration");
            entity.Property(e => e.TechImg)
                .HasMaxLength(255)
                .HasComment("技法图片")
                .HasColumnName("tech_img");
            entity.Property(e => e.TechName)
                .HasMaxLength(255)
                .HasComment("技法名")
                .HasColumnName("tech_name");
            entity.Property(e => e.TechPrice)
                .HasPrecision(10, 2)
                .HasComment("价格")
                .HasColumnName("tech_price");
            entity.Property(e => e.TechType)
                .HasMaxLength(50)
                .HasComment("技法类型")
                .HasColumnName("tech_type");
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
